/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.crm.store;

import java.math.BigDecimal;
import java.util.Date;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.N100;
import queenb.web.store.EmployeeStore;
import queenb.web.util.PackageContants;

/**
 *
 * @author Thanh Luan
 */
public class V030Store extends N100 {
     public List<N100> vcurpks_listoftabv180(int pnFV050, int pnFN100, int pnPV150, int pnOFFSET, int pnLIMIT, int pnOFF, int pnODD, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv180, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnPV150),
                    new Param(OracleTypes.INTEGER, pnOFFSET),
                    new Param(OracleTypes.INTEGER, pnLIMIT),
                    new Param(OracleTypes.INTEGER, pnOFF),
                    new Param(OracleTypes.INTEGER, pnODD),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);
    }
    public List<N100> listV030(int pnFH000, int pnFH200, int pnFV050, int pnFN100, int pnSORT, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_V030, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnSORT),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }

    public List<N100> combo_listoftabv030new(int pnFH000, int pnFH200, int pnFV050, int pnFN100, int pnOFFSET, int pnLIMIT, int pnSORT, int pnDIRECTION, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv030new, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnOFFSET),
                    new Param(OracleTypes.INTEGER, pnLIMIT),
                    new Param(OracleTypes.INTEGER, pnSORT),
                    new Param(OracleTypes.INTEGER, pnDIRECTION),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }
    // danh sach theo Tou rmoi 

    public List<N100> vcurpks_listoftabv030new(int pnFH000, int pnFH200, int pnFV050, int pnFN100, int pnOFFSET, int pnLIMIT, int pnSORT, int pnDIRECTION, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv030new, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnOFFSET),
                    new Param(OracleTypes.INTEGER, pnLIMIT),
                    new Param(OracleTypes.INTEGER, pnSORT),
                    new Param(OracleTypes.INTEGER, pnDIRECTION),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }
    
     // danh sach nguoi dai diẹn

    public List<N100> vcurpks_listoftabv030dd(int pnFV050, int pnVN062,int pnFN100,String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv030dd, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnVN062),
                     new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }

    // danh sach theo Tou rmoi  VISA
    public List<N100> vcurpks_listoftabv030visa(int pnFH000, int pnFH200, int pnFN100, int pnFV050, int pnOFFSET, int pnLIMIT, int pnSORT, int pnDIRECTION, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv030visa, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnOFFSET),
                    new Param(OracleTypes.INTEGER, pnLIMIT),
                    new Param(OracleTypes.INTEGER, pnSORT),
                    new Param(OracleTypes.INTEGER, pnDIRECTION),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        return super.find(dataStatement, N100.class);
    }

    public List<N100> searchListV030(int pnFH000, int pnFH200, int pnFV050, String pvNV101, String pvSEARC, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.SEARCH_V030, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvNV101),
                    new Param(OracleTypes.CHAR, pvSEARC),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }

    public List<N100> VCURPKS_LISTOFTABV030V(int pnFV050, String pvSEARC, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_V030V, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvSEARC),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }

    public List<N100> VCURPKS_LISTOFTABV030V1(int pnFV050, String pvSEARC, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_V030V1, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvSEARC),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }

    public List<N100> getListpersonalDD(int pnFH000, int pnFH200, String keysrearch, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.SEARCH_PERSONAL_DD, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, keysrearch),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(EmployeeStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(EmployeeStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(EmployeeStore.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public List<N100> removeListV030(int pnFH000, int pnFH200, int pnFV050, String pvNV101, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.REMOVE_V030, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvNV101),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }

    // @Kiêm tra quy trinh cho VISA
    public int stdv_tools_activatabv030visa(int pnFH000, int pnFH200, int pnFV050, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.stdv_tools_activatabv030visa, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(V030Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
    // @khach hang theo tour, ham moi

    public int stdv_tools_inserttabv030new(int pnFV050, int pnFN100,
            String pvVV031, String pvVV032, double pnVN033, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.stdv_tools_inserttabv030new, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.CHAR, pvVV031),
                        new Param(OracleTypes.CHAR, pvVV032),
                        new Param(OracleTypes.DOUBLE, pnVN033),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(V030Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

    // thiet lap room
    public int stdv_tools_updatetabv030roo(int pnFV050, int pnFN100, int pnVN035,
            String pvVV036, String pvVV037, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.stdv_tools_updatetabv030roo, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.INTEGER, pnVN035),
                        new Param(OracleTypes.CHAR, pvVV036),
                        new Param(OracleTypes.CHAR, pvVV037),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(V030Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
// danh sach nguoi da co room

    public List<N100> vcurpks_listoftabv030roo(int fh000, int fh200, int fv050, int fn100, int offset, int limit, int fooo, int foo, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv030roo, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, fh000),
                    new Param(OracleTypes.INTEGER, fh200),
                    new Param(OracleTypes.INTEGER, fv050),
                    new Param(OracleTypes.INTEGER, fn100),
                    new Param(OracleTypes.INTEGER, offset),
                    new Param(OracleTypes.INTEGER, limit),
                    new Param(OracleTypes.INTEGER, fooo),
                    new Param(OracleTypes.INTEGER, foo),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }
    
    // danh sach nguoi chua co hamh khong

    public List<N100> vcurpks_listoftabv030hk(int fh000, int fh200, int fv050, int fn100, int offset, int limit, int fooo, int foo, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv030hk, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, fh000),
                    new Param(OracleTypes.INTEGER, fh200),
                    new Param(OracleTypes.INTEGER, fv050),
                    new Param(OracleTypes.INTEGER, fn100),
                    new Param(OracleTypes.INTEGER, offset),
                    new Param(OracleTypes.INTEGER, limit),
                    new Param(OracleTypes.INTEGER, fooo),
                    new Param(OracleTypes.INTEGER, foo),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);


    }

    public int updateV030(int pnFV050, int pnFN100,
            String pvVV031, String pvVV032, double pnVN033, String pvVV038, String pvVV039, String pvVV040, String pvVV041, String pvVV042,
            String pvVV043, String pvVV044, String pvVV045, String pvVV046, Date pdVD047, Date pdVD048,
            String pvVV038T, String pvVV039T, String pvVV040T, String pvVV041T, String pvVV042T,
            String pvVV043T, String pvVV044T, String pvVV045T, String pvVV046T, Date pdVD047T, Date pdVD048T, String VV061, int VN062,
            String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_V030, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.CHAR, pvVV031),
                        new Param(OracleTypes.CHAR, pvVV032),
                        new Param(OracleTypes.DOUBLE, pnVN033),
                        new Param(OracleTypes.CHAR, pvVV038),
                        new Param(OracleTypes.CHAR, pvVV039),
                        new Param(OracleTypes.CHAR, pvVV040),
                        new Param(OracleTypes.CHAR, pvVV041),
                        new Param(OracleTypes.CHAR, pvVV042),
                        new Param(OracleTypes.CHAR, pvVV043),
                        new Param(OracleTypes.CHAR, pvVV044),
                        new Param(OracleTypes.CHAR, pvVV045),
                        new Param(OracleTypes.CHAR, pvVV046),
                        new Param(OracleTypes.DATE, pdVD047),
                        new Param(OracleTypes.DATE, pdVD048),
                        new Param(OracleTypes.CHAR, pvVV038T),
                        new Param(OracleTypes.CHAR, pvVV039T),
                        new Param(OracleTypes.CHAR, pvVV040T),
                        new Param(OracleTypes.CHAR, pvVV041T),
                        new Param(OracleTypes.CHAR, pvVV042T),
                        new Param(OracleTypes.CHAR, pvVV043T),
                        new Param(OracleTypes.CHAR, pvVV044T),
                        new Param(OracleTypes.CHAR, pvVV045T),
                        new Param(OracleTypes.CHAR, pvVV046T),
                        new Param(OracleTypes.DATE, pdVD047T),
                        new Param(OracleTypes.DATE, pdVD048T),
                        new Param(OracleTypes.CHAR, VV061),
                        new Param(OracleTypes.INTEGER, VN062),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(dateStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(V030Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

        public int stdv_tools_stornotabv030roo(int pnFV050, int pnFN100, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.stdv_tools_stornotabv030roo, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.CHAR, pvLOGIN)});

        return super.update(dataStatement, N100.class);

    }
    
    public int deleteV030(int pnFV050, int pnFN100, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_V030, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.CHAR, pvLOGIN)});

        return super.update(dataStatement, N100.class);

    }

    public List<N100> CombK400(
            int pnFH000,
            int pnFH200,
            int pnFK400,
            String pvLogin) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.COMBOBOX_K400, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFK400),
                    new Param(OracleTypes.CHAR, pvLogin),});

        return super.find(dataStatement, N100.class);

    }
    // list v030
     public List<N100> combcurpks_combtabv030(
            int pnFH000,
            int pnFH200,
            int pnFV050,
            String pvLogin) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.combcurpks_combtabv030, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvLogin),});

        return super.find(dataStatement, N100.class);

    }
     // danh sach nguoi dai dien
     // list v030
     public List<N100> combcurpks_combtabv030dd(
            int pnFH000,
            int pnFH200,
            int pnVN062,
            int pnFV050,
            String pvLogin) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.combcurpks_combtabv030dd, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                     new Param(OracleTypes.INTEGER, pnVN062),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvLogin),});

        return super.find(dataStatement, N100.class);

    }

    public int updateColumnV030(String pvSCHEMA, String pvTABNAME, String pvCOLNAME, double pvVALUE, String pvPRIMARYKEY, int pnCONDITION, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_COLUMN_V030_PRICE, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.CHAR, pvSCHEMA),
                        new Param(OracleTypes.CHAR, pvTABNAME),
                        new Param(OracleTypes.CHAR, pvCOLNAME),
                        new Param(OracleTypes.DOUBLE, pvVALUE),
                        new Param(OracleTypes.CHAR, pvPRIMARYKEY),
                        new Param(OracleTypes.INTEGER, pnCONDITION),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.updateNoOutParam(dateStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(V030Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

    public List<N100> LISTOFTABV030T(int pnFH000, int pnFH200, int pnFV050, int pnFN100, int pnFQ100, String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.LIST_V030T, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnFQ100),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, N100.class);

    }

    public int updateColumnV030Cus(String pvSCHEMA, String pvTABNAME, String pvCOLNAME, String pnVALUE, String pvPRIMARYKEY, int pnCONDITION, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.ORG_UPDATE_N100, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.CHAR, pvSCHEMA),
                        new Param(OracleTypes.CHAR, pvTABNAME),
                        new Param(OracleTypes.CHAR, pvCOLNAME),
                        new Param(OracleTypes.CHAR, pnVALUE),
                        new Param(OracleTypes.CHAR, pvPRIMARYKEY),
                        new Param(OracleTypes.INTEGER, pnCONDITION),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.updateNoOutParam(dateStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(CustomerStore.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

    public int updateColumnV030VN034(String pvSCHEMA, String pvTABNAME, String pvCOLNAME, int pnVALUE, String pvPRIMARYKEY, int pnCONDITION, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.ORG_UPDATE_N100, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.CHAR, pvSCHEMA),
                        new Param(OracleTypes.CHAR, pvTABNAME),
                        new Param(OracleTypes.CHAR, pvCOLNAME),
                        new Param(OracleTypes.INTEGER, pnVALUE),
                        new Param(OracleTypes.CHAR, pvPRIMARYKEY),
                        new Param(OracleTypes.INTEGER, pnCONDITION),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.updateNoOutParam(dateStatement, N100.class);
        } catch (SQLException ex) {
            Logger.getLogger(CustomerStore.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
}
